// IDD_New_Dialog.cpp : implementation file
//

#include "stdafx.h"
#include "wfdeq.h"
#include "IDD_New_Dialog.h"
#include "afxdialogex.h"


// IDD_New_Dialog dialog

IMPLEMENT_DYNAMIC(IDD_New_Dialog, CDialogEx)

IDD_New_Dialog::IDD_New_Dialog(CWnd* pParent /*=NULL*/)
	: CDialogEx(IDD_New_Dialog::IDD, pParent)
	, pdeType(0)
	, examples(_T("Select Partial Differential Equation Type"))
	, boolOK(false)
{
}

IDD_New_Dialog::~IDD_New_Dialog()
{

}

void IDD_New_Dialog::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EXAMPLE, examples);
	DDX_Control(pDX, IDC_EXAMPLE, cntrlExample);
	DDX_Control(pDX, IDOK, butOK);
}


BEGIN_MESSAGE_MAP(IDD_New_Dialog, CDialogEx)
	ON_BN_CLICKED(IDC_RADIO_TYPE0, &IDD_New_Dialog::OnBnClickedRadioType0)
	ON_BN_CLICKED(IDC_RADIO_TYPE1, &IDD_New_Dialog::OnBnClickedRadioType1)
	ON_BN_CLICKED(IDC_RADIO_TYPE2, &IDD_New_Dialog::OnBnClickedRadioType2)
	ON_BN_CLICKED(IDC_RADIO_TYPE3, &IDD_New_Dialog::OnBnClickedRadioType3)
END_MESSAGE_MAP()


// IDD_New_Dialog message handlers


void IDD_New_Dialog::OnBnClickedRadioType0()
{
	pdeType=0;
	examples=_T("Eg: Poisson Equation, Laplace equation");
	cntrlExample.SetWindowTextW(_T("Eg: Poisson Equation, Laplace equation"));
	if(!boolOK){	butOK.EnableWindow(1);	boolOK=true;}
}


void IDD_New_Dialog::OnBnClickedRadioType1()
{
	pdeType=1;
	examples=_T("Eg: Heat equation");
	cntrlExample.SetWindowTextW(_T("Eg: Heat equation"));
	if(!boolOK){	butOK.EnableWindow(1);	boolOK=true;}
}


void IDD_New_Dialog::OnBnClickedRadioType2()
{
	pdeType=2;
	examples=_T("Eg: Time independent(Unsteady) Burgers' equation");
	cntrlExample.SetWindowTextW(_T("Eg: Time independent(Unsteady) Burgers' equation"));
	if(!boolOK){	butOK.EnableWindow(1);	boolOK=true;}
}


void IDD_New_Dialog::OnBnClickedRadioType3()
{
	pdeType=3;
	examples=_T("Eg: Time dependent(Steady) Burgers' equation");
	cntrlExample.SetWindowTextW(_T("Eg: Time dependent(Steady) Burgers' equation"));
	if(!boolOK){	butOK.EnableWindow(1);	boolOK=true;}
}
